$OpenBSD: patch-bsd_c,v 1.2 2017/04/12 23:17:57 jca Exp $
--- bsd.c.orig	Sat May  1 06:21:53 1993
+++ bsd.c	Thu Apr 13 01:16:06 2017
@@ -74,26 +74,16 @@ long gettz()
 #define SEC_IN_DAY	(24L * 60L * 60L)
 #define INV_VALUE		(SEC_IN_DAY + 1L)
 	static long retval = INV_VALUE;	     /* cache, init to impossible value */
-#ifndef __386BSD__
-   struct timeval tp;
-   struct timezone tzp;
-#else
    time_t lt;
    struct tm *tm;
-#endif
+
 	if (retval != INV_VALUE)				 /* if have cached value, return it */
 		return retval;
-#ifndef __386BSD__
-   gettimeofday (&tp, &tzp);              /* specific to 4.3BSD */
-   /* return (tzp.tz_minuteswest * 60); */ /* old incorrect code */
-	/* Timezone fix thanks to Bill Davidsen <wedu@ge-crd.ARPA> */
-	/* !! - ache@hq.demos.su */
-	retval = tzp.tz_minuteswest * 60 - (tzp.tz_dsttime != 0) * 3600L;
-#else
+
 	time(&lt);
 	tm = localtime(&lt);
 	retval = -tm->tm_gmtoff;
-#endif
+
 	return retval;
 }
 
@@ -103,15 +93,19 @@ long gettz()
 /* Standard UNIX-specific file attribute routines */
 #include "nixmode.i"
 
+#if defined(__FreeBSD__) || defined(__OpenBSD__) || defined(__NetBSD__)
+#include <unistd.h>
+#else
 #ifndef SEEK_CUR
 # define  SEEK_CUR    1
 #endif
+#endif
 
 /* Truncate a file. */
 int zootrunc(f) FILE *f;
 {
-	extern long lseek();
-	long seekpos;
+	extern off_t lseek();
+	off_t seekpos;
 	int fd = fileno(f);
 	seekpos = lseek(fd, 0L, SEEK_CUR);
 	if (seekpos >= 0)
